import request from '@/utils/request'

//列表
export function studentList(data) {
  return request({
    url: 'student',
    method: 'get',
    params: data
  })
}
//建档信息
export function recordhistory(data) {
  return request({
    url: 'student/archiveshistory',
    method: 'get',
    params: data,
    headers: {
      'showLoading': true,
      'loadingTarget': '.innerloding'
    }
  })
}
// 新增
export function createData(data) {
  return request({
    url: 'student/create',
    method: 'post',
    data
  })
}

// 详情
export function getRead(data) {

  return request({
    url: 'student/read',
    method: 'get',
    params: data,
    headers: {
      'showLoading': false
    }
  })
}
// 详情
export function getReadDilog(data) {

  return request({
    url: 'student/read',
    method: 'get',
    params: data,
    headers: {
      'showLoading': true,
      'loadingTarget': '.innerloding'
    }
  })
}
// 报名信息
export function enrolldetail(data) {

  return request({
    url: 'student/enrolldetail',
    method: 'get',
    params: data,
    headers: {
      'showLoading': true,
      'loadingTarget': '.innerloding'
    }
  })
}
// 换班信息
export function changeCourseHistory(data) {

  return request({
    url: 'student/changeCourseHistory',
    method: 'get',
    params: data,
    headers: {
      'showLoading': true,
      'loadingTarget': '.innerloding'
    }
  })
}
//编辑
export function updateData(data) {
  return request({
    url: 'student/update',
    method: 'put',
    data
  })
}

//删除
export function deleteData(data) {
  return request({
    url: 'student/delete',
    method: 'delete',
    data
  })
}

//报名点选项
export function getbmdOption(data) {
  return request({
    url: 'enroll/option ',
    method: 'get',
    params: data
  })
}

//获取训练场选项
export function getxlcOption(data) {
  return request({
    url: 'train/option',
    method: 'get',
    params: data
  })
}

//关联课程
export function getcourseOption(data) {
  return request({
    url: 'course/option',
    method: 'get',
    params: data
  })
}

//学员报名
export function applyStudet(data) {
  return request({
    url: 'student/enroll',
    method: 'put',
    data,
    headers: {
      'showLoading': false
    }
  })
}

//收取考试费
export function examcost(data) {
  return request({
    url: 'student/examcost',
    method: 'post',
    data
  })
}

//修改学车进度
export function updatelearnrate(data) {
  return request({
    url: 'student/updatelearnrate',
    method: 'put',
    data
  })
}

//学员补交
export function repay(data) {
  return request({
    url: 'student/repay',
    method: 'post',
    data
  })
}

//换班
export function changecourse(data) {
  return request({
    url: 'student/changecourse',
    method: 'post',
    data
  })
}

//建档 列表
export function documenstudentlist(data) {
  return request({
    url: 'student',
    method: 'get',
    params: data
  })
}

//学员建档
export function studentrecord(data) {
  return request({
    url: 'student/archives',
    method: 'post',
    data
  })
}

// 学员成绩写入
export function achievementcreate(data) {
  return request({
    url: 'student/achievement/create',
    method: 'post',
    data
  })
}

//学员成绩记录
export function getachievementlist(data) {
  return request({
    url: 'student/achievement',
    method: 'get',
    params: data,
    headers: {
      'showLoading': true,
      'loadingTarget': '.innerloding'
    }
  })
}

//退学
export function dropout(data) {
  return request({
    url: 'student/dropout',
    method: 'post',
    data
  })
}

//退学
export function studentHandoutticket(data) {
  return request({
    url: 'student/handoutticket',
    method: 'post',
    data,
    headers: {
      'showLoading': false
    }
  })
}

// 重学/复训
export function reCharge(data) {
  return request({
    url: 'student/reCharge',
    method: 'post',
    data,
    headers: {
      'showLoading': false
    }
  })
}

// 获取退费信息
export function getRefund(data) {
  return request({
    url: 'student/getRefund',
    method: 'get',
    params: data,
    headers: {
      'showLoading': false
    }
  })
}

// 确认退费
export function approvalRefund(data) {
  return request({
    url: 'student/approvalRefund',
    method: 'put',
    data
  })
}

// 配置详情
export function coupontryfreeconfig(data) {
  return request({
    url: 'coupon/tryfreeconfig',
    method: 'get',
    params: data,
  })
}


// 修改配置
export function coupontryfreeconfigPut(data) {
  return request({
    url: 'coupon/tryfreeconfig',
    method: 'put',
    data,
  })
}

// 试学记录
export function coupontryFreeList(data) {
  return request({
    url: 'coupon/tryFreeList',
    method: 'get',
    params: data,
  })
}
// 约车记录
export function studentGetcoursehistory(data) {
  return request({
    url: '/student/getcoursehistory',
    method: 'get',
    params: data,
    headers: {
      'showLoading': true,
      'loadingTarget': '.innerloding'
    }
  })
}
// 约考记录
export function studentGetexamhistory(data) {
  return request({
    url: '/student/getexamhistory',
    method: 'get',
    params: data,
    headers: {
      'showLoading': true,
      'loadingTarget': '.innerloding'
    }
  })
}
// 约考场地下拉
export function examOptionrelation(data) {
  return request({
    url: '/exam/optionrelation',
    method: 'get',
    params: data,
  })
}
// 约考录入
export function studentInputexamhistory(data) {
  return request({
    url: '/student/inputexamhistory',
    method: 'post',
    data,
  })
}
// 约车弹框列表
export function studentGetticket(data) {
  return request({
    url: '/student/getticket',
    method: 'get',
    params: data,
    headers: {
      'showLoading': true,
      'loadingTarget': '.innerloding'
    }
  })
}
// 修改约课设置
export function courseruleSetting(data) {
  return request({
    url: '/student/courserule/setting',
    method: 'put',
    data,
    headers: {
      'showLoading': false,
    }
  })
}

export function courserule(data) {
  return request({
    url: '/student/courserule',
    method: 'get',
    params:data,
    headers: {
      'showLoading': true,
    }
  })
}

